package com.gjy.datetime;

import org.joda.time.DateTime;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-01-05 08:43:22
 */
public class JodaUtil {

    public static Map<String, Date> minAndMax(Date date) {
        HashMap<String, Date> map = new HashMap<>();
        Date min = new DateTime(date).millisOfDay().withMinimumValue().toDate();
        Date max = new DateTime(date).millisOfDay().withMaximumValue().toDate();
        map.put("min", min);
        map.put("max", max);
        return map;
    }
}
